package com.project.util.codingUtils;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * @Author(王思翰)
 * @Description(类的描述) 日期转换工具类
 * @Date(创建时间) 2021/10/8 11:18
 */
public class TimeChangeUtil {
    public static String timeUtil() {
        LocalDate date = LocalDate.now();
        DateTimeFormatter formatters = DateTimeFormatter.ofPattern("d / MM / uuuu");
        String text = date.format(formatters);
        LocalDate parsedDate = LocalDate.parse(text, formatters);

        System.out.println("date：" + date); // date：2016-09-25
        System.out.println("Text format" + text); //文本格式25/09/2016
        System.out.println("parsedDate：" + parsedDate); // parsedDate：2016-09-25

        //我想将LocalDate parsedDate存储为25/09/2016
        return text;
    }
}
